﻿/* 
 * 
 * Copyright 2013 Bendsoft. All rights reserved.
 * http://www.bendsoft.com
 * 
 * This code is distributed under the New BSD License (BSD).
 * 
 * @package     Camelot SharePoint Integration Plugins Library
 * @codeplex    http://camelottoolkit.codeplex.com
 * @license     New BSD License (BSD)
 * 
 */

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Camelot.SharePointIntegration.IntegrationService;
using Camelot.SharePointIntegration.IntegrationService.Entities;
using Camelot.SharePointIntegration.Client;

namespace Camelot.SharePointIntegration.Plugins
{
    public abstract class ListDataPlugin: IServicePlugin
    {
        ServicePluginResult IServicePlugin.Execute(Task task)
        {
            using (var listData = ListDataUtility.CreateListData(task))
            {
                return ProcessData(task, listData, task.Plugin.Parameters.ToList());
            }
        }

        protected abstract ServicePluginResult ProcessData(Task task, ListData data, List<Parameter> parameters);
    }
}
